package cn.edu.usst.cs.goldfish.booking.meetingroom.mapstruct;

import cn.edu.usst.cs.goldfish.booking.meetingroom.model.MeetingSlot;
import cn.edu.usst.cs.goldfish.booking.meetingroom.web.dto.booking.Slot;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface BookingMapper {
    @Mappings({@Mapping(target = "roomId", ignore = true), @Mapping(target = "roomName", ignore = true), @Mapping(target = "occupied", ignore = true), @Mapping(target = "meetingId", ignore = true), @Mapping(target = "meetingTopic", ignore = true), @Mapping(target = "segment", source = "part")})
    Slot fromMeetingSlot(MeetingSlot slot);


    /**
     * convert from Slot to MeetingSlot
     */
    @Mappings({
            @Mapping(target = "part", source = "segment")
            , @Mapping(target = "id", ignore = true)
    })
    MeetingSlot fromSlot(Slot slot);


}
